package com.gs.wzmanager.dao;

import com.gs.wzmanager.dao.mapper.ForcastReviseMapper;
import com.gs.wzmanager.entity.ForcastRevise;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Legolas
 * Date: 2017/10/31 0031
 */
@Lazy(false)
@Repository("forcastReviseDao")
public class ForcastReviseDao {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    ForcastReviseMapper mapper;

    public void addReviseThree(ForcastRevise revise){
        try {
            logger.info("addReviseThree->{}",revise);
            mapper.addReviseThree(revise);
        } catch (Exception e) {
            logger.info("addReviseThree->{}",e.getMessage());
        }
    }

    public void addReviseWeek(ForcastRevise revise){
        try {
            logger.info("addReviseWeek->{}",revise);
            mapper.addReviseWeek(revise);
        } catch (Exception e) {
            logger.info("addReviseWeek->{}",e.getMessage());
        }
    }

    public List<ForcastRevise> queryCYReviseThree(){
        try {
            return mapper.queryCYReviseThree();
        } catch (Exception e) {
            logger.info("queryCYReviseThree->{}",e.getMessage());
        }
        return null;
    }

    public List<ForcastRevise> queryCYReviseWeek(){
        try {
            return   mapper.queryCYReviseWeek();
        } catch (Exception e) {
            logger.info("queryCYReviseWeek->{}",e.getMessage());
        }
        return null;
    }

    public void updateReviseThree(ForcastRevise forcastRevise){
        try {
            mapper.updateReviseThree(forcastRevise);
        } catch (Exception e) {
            logger.info("updateReviseThree->{}",e.getMessage());
        }
    }

    public void updateReviseWeek(ForcastRevise forcastRevise){
        try {
            mapper.updateReviseWeek(forcastRevise);
        } catch (Exception e) {
            logger.info("updateReviseWeek->{}",e.getMessage());
        }
    }



}
